package com.multidisplay.controller;

import com.multidisplay.po.BaseData;
import com.multidisplay.po.DisplayList;
import com.multidisplay.po.VideoDisarea;
import com.multidisplay.service.DisplayListService;
import com.multidisplay.service.VideoDisareaService;
import com.multidisplay.service.impl.BaseDataServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@Api(tags="视频展示区管理相关接口")
public class VideoDisareaController {
    @Autowired
    private VideoDisareaService videoDisareaService;

    @PostMapping("/videodisareaadd")
    @ApiOperation("增加VideoDisarea")
    public void add(VideoDisarea videoDisarea){
        videoDisareaService.add(videoDisarea);
    }

    @DeleteMapping("/videodisareadelById")
    @ApiOperation("根据id删除VideoDisarea")
    public void delById(int id){
        videoDisareaService.delById(id);
    }

    @GetMapping("/videodisareaselectById")
    @ApiOperation("根据id查询VideoDisarea")
    public List<VideoDisarea> selectById(int id){
        return videoDisareaService.selectById(id);
    }

    @GetMapping("/videodisareaselectByCategory")
    @ApiOperation("根据category查询VideoDisarea")
    public List<VideoDisarea> selectByCategory(String category){
        return videoDisareaService.selectByCategory(category);
    }

    @GetMapping("/videodisareaselectAll")
    @ApiOperation("查询所有")
    public List<VideoDisarea> selectAll(){
        return videoDisareaService.selectAll();
    }

    @PutMapping("/videodisareaupdate")
    @ApiOperation("更新VideoDisarea")
    public void update(VideoDisarea videoDisarea){
        videoDisareaService.update(videoDisarea);
    }

}
